/*
 * @Date: 2021-11-30 15:42:07
 * @LastEditors: 春贰
 * @Desc: 
 * @LastEditTime: 2022-10-11 10:08:10
 * @FilePath: \web\src\main.js
 */
import { createApp } from "vue";
import App from "./App.vue";
import Router from "./core/route";
import Store from "./core/store/index.js";
import common from "./core/component/index.js";
import  Antd  from "ant-design-vue"; 
import { message,notification } from "ant-design-vue";
import i18n from './core/locale/index.js';
import directives from "./core/directive/index.js"
import * as antIcons from '@ant-design/icons-vue'; 
//import "./mock"; 
import "ant-design-vue/dist/antd.less";
import "./core/assets/css/index.less";   
import { sysconfigs } from "@/core/api/module/tools"; 
 
import contextmenu from 'vue3-contextmenu'   //全局右键菜单
import 'vue3-contextmenu/dist/vue3-contextmenu.css' 
const app = createApp(App); 
app.use(contextmenu)
app.use(Antd);
app.use(common);
app.use(i18n);
app.use(Store);
app.use(Router); 

Object.keys(directives).forEach(directive => {  
  app.directive(directive, directives[directive])
})

Object.keys(antIcons).forEach(key => {
  app.component(key, antIcons[key])
})

message.config({
  top: `100px`,
  duration: 2,
  maxCount: 3,
});

notification.config({
  duration : 5
})

//挂载图标在全局
app.config.globalProperties.$antIcons = antIcons 

//挂载全局配置
 sysconfigs().then((sysconfigsData) => {
  //console.log('全局配置:{$CONFIGS}',sysconfigsData.data);
  app.config.globalProperties.$CONFIGS = JSON.parse(sysconfigsData.data)
  app.mount("#app");  
});




         





 